﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <!-- Documenting T:NAnt.Core.Filters.ReplaceString-->
  <head>
    <meta http-equiv="Content-Language" content="en-ca" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="../style.css" />
    <title>&lt;replacestring&gt; Filter</title>
  </head>
  <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
      <tr>
        <td class="NavBar-Cell">
          <a href="http://nant.sourceforge.net">
            <b>NAnt</b>
          </a>
          <img alt="-&gt;" src="../images/arrow.gif" />
          <a href="../index.html">Help</a>
          <img alt="-&gt;" src="../images/arrow.gif" />
          <a href="../filters/index.html">Filter Reference</a>
          <img alt="-&gt;" src="../images/arrow.gif" /> &lt;replacestring&gt;</td>
        <td class="NavBar-Cell" align="right">
                        v0.91-alpha2</td>
      </tr>
    </table>
    <h1>&lt;replacestring&gt;</h1>
    <p class="topicstatus">[This is preliminary documentation and subject to change.]</p>
    <p> Replaces all occurrences of a given string in the original input with user-supplied replacement string. </p>
    <p> This filter replaces all occurrences of a given string in the original input stream with a user-supplied replacement string. By default string comparisons are case sensitive but this can be changed by setting the optional <code>ignorecase</code> attribute to <b>true</b>. </p>
    <p> To use this filter specify the string to be replaced with the <code>from</code> attribute and the string to replace it with using the <code>to</code> attribute. </p>
    <p> Filters are intended to be used as a element of a <a href="../types/filterchain.html">&lt;filterchain&gt;</a>. </p>
    <h3>Parameters</h3>
    <div class="table">
      <table>
        <tr>
          <th>Attribute</th>
          <th style="text-align: center;">Type</th>
          <th>Description</th>
          <th style="text-align: center;">Required</th>
        </tr>
        <tr>
          <td valign="top" class="required">from</td>
          <td style="text-align: center;">string</td>
          <td> The string to be replaced. </td>
          <td style="text-align: center;">True</td>
        </tr>
        <tr>
          <td valign="top">ignorecase</td>
          <td style="text-align: center;">bool</td>
          <td> Determines if case will be ignored. The default is <b>false</b>. </td>
          <td style="text-align: center;">False</td>
        </tr>
        <tr>
          <td valign="top">to</td>
          <td style="text-align: center;">string</td>
          <td> The new value for the replaced string. Am empty string is permissible. </td>
          <td style="text-align: center;">False</td>
        </tr>
        <tr>
          <td valign="top">if</td>
          <td style="text-align: center;">bool</td>
          <td> If <b>true</b> then the filter will be used; otherwise, skipped. The default is <b>true</b>. </td>
          <td style="text-align: center;">False</td>
        </tr>
        <tr>
          <td valign="top">unless</td>
          <td style="text-align: center;">bool</td>
          <td> Opposite of <code>if</code>. If <b>false</b> then the filter will be executed; otherwise, skipped. The default is <b>false</b>. </td>
          <td style="text-align: center;">False</td>
        </tr>
      </table>
    </div>
    <h3>Examples</h3>
    <ul class="examples">
      <li>
        <p> Replace all occurrences of "3.14" with "PI". </p>
        <pre class="code">
&lt;replacestring from="3.14" to="PI" /&gt;
    </pre>
      </li>
      <li>
        <p> Replace all occurrences of "string", "String", etc. with "System.String". </p>
        <pre class="code">
&lt;replacestring from="String" to="System.String" ignorecase="true" /&gt;
    </pre>
      </li>
    </ul>
    <h3>Requirements</h3>
    <div style="margin-left: 20px;">
      <b>Assembly:</b> NAnt.Core (0.91.3881.0)
            </div>
  </body>
</html>